<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!--访问该页面时，在此处生成CSRF令牌-->
    <!--	<meta name="_csrf" th:content="${_csrf.token}">-->
    <!--	<meta name="_csrf_header" th:content="${_csrf.headerName}">-->
    <link rel="icon" href="https://undraw.co/favicon-32x32.png"/>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" crossorigin="anonymous">
    <link rel="stylesheet" th:href="@{/css/global.css}" />
    <style>
        .btn{
            margin-top: 10px;
            margin-bottom: 10px;
        }
    </style>
    <title>论坛-帖子管理</title>
</head>
<body>
<div class="nk-container">
    <!-- 头部 -->
    <header class="bg-dark sticky-top" th:replace="index::header">
    </header>

    <!-- 内容 -->
    <div class="main">
        <div class="container">

            <!-- 用户列表 -->
            <ul class="list-unstyled">
                <form class="form-inline my-2 my-lg-0"  method="get" th:action="@{/data/searchPost}">
                    <input class="form-control mr-sm-2" type="search" aria-label="Search" name="keyword" th:value="${keyword}" placeholder="请输入帖子标题"/>
                    <button class="btn btn-outline-light my-2 my-sm-0" type="submit"  style=" ForeColor:white;background-color:black">搜索
                        <span class="badge badge-danger"th:text="${total!=0?total:''}">12</span></button>
                </form>
                <li class="nav-item ml-3 btn-group-vertical">
                    <a class="btn btn-secondary" th:href="@{/data/allDeletePost}" role="button">被删除的帖子
                        <span class="badge badge-danger"th:text="${totalDel!=0?totalDel:''}">12</span></a>
                </li>
                <li class="nav-item ml-3 btn-group-vertical">
                    <a class="btn btn-secondary" th:href="@{/data/allWonderfulPost}" role="button">加精贴
                        <span class="badge badge-danger"th:text="${totalWon!=0?totalWon:''}">12</span></a>
                </li>
                <li class="nav-item ml-3 btn-group-vertical">
                    <a class="btn btn-secondary" th:href="@{/data/allTopPost}" role="button">置顶帖
                        <span class="badge badge-danger"th:text="${totalTop!=0?totalTop:''}">12</span></a>
                </li>
                <li class="nav-item ml-3 btn-group-vertical">
                    <a class="btn btn-primary" th:href="@{/data/allPost}" role="button">返回</a>
                </li>
                <div class="mt-4">
                    <li class="border-bottom pb-3 mt-4" th:each="map:${discussPosts}">
                        <div class="font-size-16 text-info">
                            <a th:href="@{|/discuss/detail/${map.id}|}" class="text-info" th:utext="${map.title}">

                            </a>
                            <ul class="d-inline float-right">
                                <a class="btn btn-danger btn-sm" role="button" href="javascript:;" th:onclick="|unBlack(this,${map.id})|"
                                   sec:authorize="hasAnyAuthority('admin')">
                                    <span th:utext="${map.status==2?'取消拉黑':'拉黑'}">拉黑</span>
                                </a>
                                <a class="btn btn-danger btn-sm" role="button" href="javascript:;" th:onclick="|unWonderful(this,${map.id})|"
                                   sec:authorize="hasAnyAuthority('admin')"
                                th:if="${map.status!=2}">
                                    <span th:utext="${map.status==1?'取消加精':'加精'}">加精</span>
                                </a>
                                <a class="btn btn-danger btn-sm" role="button" href="javascript:;" th:onclick="|untop(this,${map.id})|"
                                sec:authorize="hasAnyAuthority('admin')"
                                   th:if="${map.status!=2}">
                                <span th:utext="${map.type==1?'取消置顶':'置顶'}">置顶</span>
                                </a>
                                <li class="d-inline ml-2" >&nbsp;发布于 <b
                                        th:text="${#dates.format(map.createTime, 'yyyy-MM-dd HH:mm:ss')}"></b>
                                </li>
                            </ul>
                        </div>
                        <!-- 提示框 -->
                        <div class="modal fade" id="hintModal" tabindex="-1" role="dialog" aria-labelledby="hintModalLabel" aria-hidden="true">
                            <div class="modal-dialog modal-lg" role="document">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <h5 class="modal-title" id="hintModalLabel">提示</h5>
                                    </div>
                                    <div class="modal-body" id="hintBody">
                                        已点赞!
                                    </div>
                                </div>
                            </div>
                        </div>
                    </li>
                </div>
            </ul>
            <!-- 分页 -->
            <nav class="mt-5" th:replace="index::pagination">

            </nav>
        </div>
    </div>
</div>

<script src="https://code.jquery.com/jquery-3.3.1.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" crossorigin="anonymous"></script>
<script th:src="@{/js/global.js}"></script>
<script th:src="@{/js/index.js}"></script>
</body>
</html>
